/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    font-size: 13px;
    line-height: 1.4;
}

/* 顶部消息条 */
.top-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.banner-icon {
    margin-right: 8px;
    color: #ff6b6b;
    animation: pulse 2s infinite;
}

.banner-text {
    font-size: 13px;
    font-weight: 500;
}

.banner-close {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.banner-close:hover {
    background-color: rgba(255,255,255,0.2);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 应用容器 */
.app {
    min-height: 100vh;
}

.app-container {
    display: flex;
    min-height: 100vh;
    padding-top: 40px;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.logo {
    display: flex;
    align-items: center;
    padding: 0 20px 30px;
    border-bottom: 1px solid #475569;
    margin-bottom: 20px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.logo-icon i {
    font-size: 16px;
    color: white;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
}

.nav-menu {
    padding: 0 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 13px;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nav-icon {
    width: 16px;
    margin-right: 10px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 20px;
    background-color: #f8fafc;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-left h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.header-left p {
    font-size: 13px;
    color: #64748b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 13px;
}

.search-input {
    padding: 8px 12px 8px 35px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    width: 200px;
    background-color: #f8fafc;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
}

/* 联系作者 */
/* 升级按钮 */
.upgrade-btn {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    margin-top: -2px; /* 往上提一点 */
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.upgrade-icon {
    margin-right: 6px;
    font-size: 14px;
    color: #ff6b35;
}

.contact-author {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.2s;
}

.contact-author:hover {
    transform: translateY(-1px);
}

.contact-icon {
    margin-right: 6px;
    font-size: 14px;
}

.qr-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 10px;
    z-index: 100;
}

.qr-image {
    width: 120px;
    height: 120px;
    border-radius: 6px;
}

/* 用户信息卡片 */
.user-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.user-avatar {
    margin-right: 20px;
}

.user-avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
}

.user-details h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.user-details p {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.user-stats {
    display: flex;
    gap: 25px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.stat-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

/* 区域标题 */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
}

/* 测试案例统计 */
.stats-section {
    margin-bottom: 25px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-card {
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.ui-automation .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.api-automation .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.ai-generated .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.stat-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.stat-trend {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #10b981;
}

.stat-trend i {
    margin-right: 4px;
}

/* 图表区域 */
.charts-section {
    margin-bottom: 25px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.chart-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.chart-container {
    height: 120px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 180px;
    }
    
    .main-content {
        margin-left: 180px;
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .user-info-card {
        flex-direction: column;
        text-align: center;
    }
    
    .user-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 60px;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .logo-text,
    .nav-item span {
        display: none;
    }
    
    .search-input {
        width: 150px;
    }
    
    .contact-text {
        display: none;
    }
}